package org.jeecg.modules.knowledgeType.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.columnmanager.vo.ColumnManagerVO;
import org.jeecg.modules.knowledgeType.vo.KnowledgeColumnVO;

import java.util.List;

/**
 * @Description: 评论
 * @Author: jeecg-boot
 * @Date:   2020-11-12
 * @Version: V1.0
 */
public interface KnowledgeColumnMapper extends BaseMapper<KnowledgeColumnVO> {

    /**
     * TODO: 自定义栏目分页
     *
     *
     * @author ZhangHaoyu
     * @param page
     * @return java.util.List<org.jeecg.modules.columnmanager.vo.ColumnManagerVO>
     */
    @Select("SELECT id,dict_id,item_text,item_value,column_image  FROM `sys_dict_item` WHERE dict_id = '1315497341812633602'")
    List<ColumnManagerVO> myPage(Page<ColumnManagerVO> page);

    /**
     * TODO:
     *
     *
     * @author ZhangHaoyu
     * @param id
     * @return void
     */
    @Delete("delete from sys_dict_item where id = #{id}")
    void myDelete(@Param("id") String id);

    /**
     * TODO: 根据栏目名称获取知识库的Id
     *
     *
     * @author ZhangHaoyu
     * @param name
     * @return java.lang.String
     */
    @Select("SELECT dict_id FROM `sys_dict_item` where item_text = #{name}")
    String getIdByName(@Param("name") String name);



    List<ColumnManagerVO> getColumnInfoByOpenId(@Param("openId") String openId);

    /**
     * TODO: 不分页获取栏目信息
     *
     *
     * @author ZhangHaoyu
     * @return java.util.List<org.jeecg.modules.columnmanager.vo.ColumnManagerVO>
     */
    @Select("select id,dict_id,item_text,item_value,column_image from sys_dict_item where dict_id='1315497341812633602'")
    List<ColumnManagerVO> queryNotPage();

}
